<template>
  <div class="nullBox">
    <div class="nullFind">
      <img src="../../assets/images/common/null2.png" alt="" width="100%">
    </div>
    <div class="returnHomePage">
      <a :href=goBack >
        <div class="returnHomePage">{{$t('router.notFound.returnHome')}}</div>
      </a>
    </div>
  </div>
</template>

<script>
    export default {
        name: "Null",
        data() {
            return {
                goBack:''
            }
        },
        mounted() {
            this.redirect()
        },
        methods:{
            redirect(){
                const path = this.$route.path
                if(path.indexOf('/adminPage') >= 0) {
                    this.goBack = 'http://localhost/adminPage/'
                } else {
                    this.goBack = 'http://localhost/homePage'
                }
            }
        }
    }
</script>

<style scoped>
  .nullBox{
    width: 100%;
    min-height: 1000px;
    border-radius: 3px;
    padding-top: 1px;
    padding-bottom: 8px;
    background-color: white;
    margin: 0 auto;
  }
  .nullFind{
    width: 35%;
    margin: 50px auto;
  }
  .returnHomePage{
    width: 120px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 5px;
    margin: 0px auto;
    color: #f6f6f6;
    font-weight: bolder;
    font-size: 12.5px;
    letter-spacing: 1px;
    background-color: #4d8e90;
    transition: 0.3s;
  }
  .returnHomePage:hover{
    background-color: #474747;
  }
</style>
